<?php
$mTeacher = $this->maintenance;
$builder = $mTeacher->builder;
$builder->db = $this->db;
$db = $this->db;

$tabs = $db->query_select('cllg_table_tab', "TABLE_NAME='cllg_teacher'");
?>

<form id="<?php echo FORM_NAME; ?>" name="<?php echo FORM_NAME; ?>" method="post" action="<?php echo CORE_PATH; ?>" >
    <input type="hidden" id="module" name="module" value="<?php echo $this->instanceName; ?>" />
    <div id="mant_head">
        <div id="titulo">Catedratico</div>
        <div id="botones">
            <button id="cmdOk" type="button" onclick="doSubmit('operation=s')">
                <img alt=""  src="imgv2/actions/document-save.png" />
            </button>
            <button id="cmdCancel" type="button" onclick="doSubmit('')">
                <img alt=""  src="imgv2/actions/window-close.png" /></button>

        </div>
    </div>
    <div id="tabs">
        <ul>
            <li><a href="#tab1">INFORMACION PRINCIPAL</a></li>
            <?php
            foreach ($tabs as $t) {
                $ix = $t["ID"];
                $tabId = "_tab_" . $ix;
            ?>
                <li ><a href="#<?php echo $tabId; ?>"><?php echo $t["CAPTION"]; ?></a></li>
            <?php } ?>
        </ul>
        <div class="form-container" id="tab1">
            <fieldset>
                <div>
                    <label for="ID">* Identifiación:</label>
                    <input name="ID" type="text" id="ID"  />
                </div>
                <div>
                    <label for="ID">* Nombres:</label>
                    <input name="FIRST_NAME" type="text" value="" id="FIRST_NAME" size="50" maxlength="100" /></div>
                <div>
                    <label for="ID">* Apellidos:</label>
                    <input name="LAST_NAME"  type="text" id="LAST_NAME" size="50" maxlength="100" />     </div>
                <div>
                    <label for="GENDER">* Sexo:</label>
                    <select name="GENDER" size="1" id="GENDER">
                        <option value="M">Masculino</option>
                        <option value="F">Femenino</option>
                    </select>          </div>
                <div>
                    <label for="BIRTH_DATE">* Fecha Nacimiento:</label>
                    <input name="BIRTH_DATE" type="text" id="BIRTH_DATE" />
                    <input name="STATUS" type="hidden" id="STATUS" value="1" /></div>
                <div>
                    <label for="EDAD">Correo Electr&oacute;nico:</label>
                    <input name="EMAIL"  type="text" id="EMAIL" /></div>
                <div>
                    <label for="EDAD">Edad:</label>
                    <input name="EDAD" readonly="readonly" type="text" id="EDAD" /></div>
                <div>

                    <label for="PICTUREPATH">*Fotografia:</label>
                    <div  class="specialarea">
                        <a id="cargarFoto"
                           href="<?php echo CORE_PATH; ?>?module=<?PHP echo ModUploader::$INSTANCE_NAME ?>&op=uploader&<?php echo AJAX_INDICATOR; ?>=true">Cambiar</a>
                        <div id="nuevafoto"></div>
                    </div>

                </div>
                <input name="PICTURE_PATH" type="hidden" id="PICTURE_PATH" value="1" />                
            </fieldset>
        </div>

        <?php
            $ix = 1;
            foreach ($tabs as $t) {
                $ix = $t["ID"];
        ?>
                <div id="<?php echo $ix; ?>"  class="TabbedPanelsContent">
                    <div class="form-container" id="_tab_<?php echo $ix; ?>">
                        <fieldset>
                    <?php
                    $builder->build("cllg_teacher", NULL, $t['ID']);
                    ?>
                </fieldset>
            </div>
            <?php } ?>

        </div>
    </div>
</form>
<script type="text/javascript">
    jQuery("#tabs").tabs();
</script>